package com.jfsnpm.plugin.viewoffice;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.jfinal.handler.Handler;

/**
 * 处理/wopi/file/<id>/contents?access_token=<token>
 * @author 天为之殇
 *
 */
public class ViewOfficeHandler extends Handler {

	@Override
	public void handle(String target, HttpServletRequest request,
			HttpServletResponse response, boolean[] isHandled) {
		if(target.startsWith("/wopi/files")){
			target = "/ViewOffice/files/"+target.replaceAll("/", "-");
		}
		nextHandler.handle(target, request, response, isHandled);
	}

}
